package com.android_web_view;

import android.content.Context;
import android.os.Build;
import android.webkit.JavascriptInterface;
import android.widget.Toast;

/**
 * Created by Administrator on 2017/1/9.
 */
public class MyClass {

    private Context context;

    public MyClass(Context context) {
        this.context = context;
    }

    @JavascriptInterface
    public void show(){
        Toast.makeText(context, "js/html调用android方法", Toast.LENGTH_SHORT).show();
    }

    @JavascriptInterface
    public String getInfo(){

        return "手机型号："+ Build.DEVICE+"   手机api版本"+Build.VERSION.SDK_INT;
    }
}
